<%@page import="com.cn.entity.Leibie"%>
<%@page import="com.cn.dao.LeibieDao"%>
<%@page import="com.cn.entity.News"%>
<%@page import="java.util.List"%>
<%@page import="com.cn.dao.NewsDao"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>北京医院</title>
</head>
<body>

<h4>新闻管理</h4>

<h5>查看新闻</h5>
<br>
<table>
<tr>

<td>新闻编号</td>
<td>新闻主题</td>
<td>发布时间</td>
<td>查看详细</td>
</tr>
<%
 NewsDao nd=new NewsDao();
 List<News> list=nd.selectNews();  
 for (int i=0;i<list.size();i++) {
  News news=list.get(i);
%>

<tr>
<td><%=i+1 %></td>
<td><%=news.getTopic() %></td>
<td><%=news.getDate() %></td>
<td><a href="newsdetail.jsp?newsid=<%=news.getNewsid()%>">查看详细</a></td>
</tr>

<%} %>
</table>


<h5>发布新闻</h5>
<form action="NewsAddAction" method="post">
<table border="1px" bgcolor="green">

<tr><td>新闻主题 </td><td><input type="text" name="news.topic"></td> </tr>


<tr><td>新闻类别</td><td>

<%LeibieDao ld=new LeibieDao();
List<Leibie> lb=ld.selectLeibies();
%>
<select name="leibie">
<% 
for (int i=0;i<lb.size();i++) {
Leibie leibie=lb.get(i);
%>

<option><%=leibie.getLeibie() %></option>



<%}%></select>
</td> </tr>

<tr><td>新闻内容</td> <td></td></tr>
<tr><td colspan="2"><input type="text" name="news.detail"></td> </tr>

<tr><td></td> <td><input type="submit" value="增加"></td></tr>


</table>

</form>

</body>
</html>